home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 3 / 003.d81 / guess what (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  3KB  |  114 lines

  1. 1 df$="guess.data"
  2. 5 z$=chr$(34)
  3. 10 rem the game of animal
  4. 20 dim a$(4,400)
  5. 25 close8:close15:close2
  6. 30 rem init initial conditions
  7. 35 gosub 1500
  8. 40 gosub 9000
  9. 50 i=2
  10. 100 if a$(1,i)="t" then print "is it ";
  11. 105 print a$(4,i);
  12. 110 input q$:if q$="?" then gosub 2500
  13. 115 if q$="e" then gosub 1000
  14. 120 q$=left$(q$,1):if q$<>"y" and q$<>"n" then 100
  15. 130 if a$(1,i) <>"q" then 500:rem terminal
  16. 140 if q$="y" then oq=2:oi=i:i=val(a$(2,i)):goto 100
  17. 150 if q$="n" then oq=3:oi=i:i=val(a$(3,i)):goto 100
  18. 160 print "error":stop
  19. 500 if q$="n" then 600
  20. 510 print "i guessed it!!!"
  21. 520 input "try again";q$:if q$="?" then gosub 2500
  22. 530 q$=left$(q$,1):if q$<>"y" and q$<>"n" then 520
  23. 540 if q$="y"then i=2:print: goto 100
  24. 550 print "i had fun, hope you did"
  25. 552 goto63000
  26. 600 rem learn something new
  27. 620 print "well i am out of ideas..."
  28. 630 input "you were thiniking of";o$
  29. 640 print "to tell [152]"o$"[146][154]"
  30. 645 print"from [152]"a$(4,i)"[146][154]"
  31. 650 input "you would ask";a$
  32. 660 print "for [152]"o$"[146][154] the answer is "
  33. 665 input q$
  34. 670 q$=left$(q$,1):if q$<>"y"andq$<>"n" then 660
  35. 675 print"[152]please hang on while i remember this[146][154]"
  36. 680 a$(oq,oi)=str$(mi):a$(1,mi)="q":a$(4,mi)=a$
  37. 690 t1=3:t2=2:if q$="n" then t1=2:t2=3
  38. 700 a$(t1,mi)=str$(i):a$(t2,mi)=str$(mi+1)
  39. 710 mi=mi+1:a$(1,mi)="t":a$(2,mi)="":a$(3,mi)="":a$(4,mi)=o$:mi=mi+1
  40. 715 a$(1,1)=str$(mi)
  41. 720 open15,8,15:open8,8,8,df$
  42. 730 r=oi:gosub 5000:r=mi-1:gosub 5000:r=mi-2:gosub 5000:r=1:gosub5000
  43. 740 close8:close15
  44. 800 i=2:gosub2000:goto 520
  45. 999 goto63000
  46. 1000 print "[147][152]   edit data --- be carefull!!!    [146][154]"
  47. 1010 input "hardcopy list";qq$
  48. 1020 if qq$="y" then gosub 2010
  49. 1030 input "record";r:if r=0 then return
  50. 1040 for ii=1to4
  51. 1050 print "  "a$(ii,r)
  52. 1060 input "[145]";a$(ii,r)
  53. 1080 next
  54. 1090 input "update";qq$:if qq$<>"y" then 1030
  55. 1100 open15,8,15:open8,8,8,df$
  56. 1110 gosub 5000
  57. 1120 close8:close15
  58. 1130 goto 1030
  59. 1500 print "[147][152]      the game of animal     [146][154]"
  60. 1510 print"answer my questions with yes or no and"
  61. 1520 print "i will guess what you are thinking about"
  62. 1530 print"if you stump me i'll remember so it"
  63. 1540 print"won't happen again"
  64. 1550 print"please wait while i refresh my memory"
  65. 1560 print""
  66. 1570 return
  67. 2000 return
  68. 2010 open2,4
  69. 2020 print#2:print#2:print#2,"animal database"
  70. 2030 for ii=1 to mi-1
  71. 2040 print#2,ii"type="a$(1,ii)" yes#"a$(2,ii)" no#"a$(3,ii)"  thing: "a$(4,ii)
  72. 2050 next
  73. 2060 print#2:close2
  74. 2070 return
  75. 2500 print "[147][152]the things i know about are:[146][154]"
  76. 2510 for ii=1 to mi-1
  77. 2520 if a$(1,ii)="t" then print a$(4,ii)
  78. 2530 next
  79. 2540 return
  80. 5000 print#15,"p"chr$(8)chr$(rand255)chr$(r/256)chr$(0)
  81. 5006 input#15,en,em$,et,es:qn=en
  82. 5007 if en=50 then print#8,1:goto5000
  83. 5010 ol$=z$+a$(1,r)+z$+","+z$+a$(2,r)+z$+","+z$+a$(3,r)+z$+","+z$+a$(4,r)+z$
  84. 5012 print#8,ol$
  85. 5013 rem print len(ol$)":::"ol$
  86. 5015 input#15,en,em$,et,es:if en<>0thenstop
  87. 5030 return
  88. 9000 i=0
  89. 9002 open15,8,15:open8,8,8,df$:input#15,en,em$,et,es:ifen<>0thengoto9200
  90. 9005 i=i+1
  91. 9006 if i=val(a$(1,1))then mi=i:gosub2000:close8:close15:return
  92. 9007 print#15,"p"chr$(8)chr$(iand255)chr$(i/256)chr$(0)
  93. 9009 if en=50 or i=val(a$(1,1))then mi=i:gosub2000:close8:close15: return
  94. 9010 input#8,a$(1,i),a$(2,i),a$(3,i),a$(4,i)
  95. 9020 goto 9005
  96. 9200 close8:close15
  97. 9210 i=1
  98. 9220 i=i+1
  99. 9230 reada$(1,i),a$(2,i),a$(3,i),a$(4,i)
  100. 9240 if a$(1,i)<>"" then 9220
  101. 9245 mi=i:a$(1,1)=str$(mi)
  102. 9250 open15,8,15:open8,8,8,df$+",l,"+chr$(80)
  103. 9260 for r=1 to mi-1
  104. 9270 gosub5000
  105. 9290 next r
  106. 9300 close8:close15:gosub2000:return
  107. 9500 data "q","3","4","is it alive"
  108. 9510 data "t","","","a frog"
  109. 9520 data "t","","","a desk"
  110. 9530 data "","","",""
  111. 63000 forc0=1to1000:next:print"[147]"
  112. 63005 print"load"chr$(34)"payload"chr$(34)",8":print"run"
  113. 63010 poke631,13:poke632,13:poke198,2:end
  114.